<?php		
	include_once 'includes/snminit.php';
	ob_start();
  	include_once 'includes/session.php';
    header("Cache-control: private"); 
   	include_once 'includes/constants.php';
   	include_once 'includes/functions.php';
   	include_once 'includes/allstripslashes.php';   
   
    $partners = new partners;
    $partners->connection($host,$user,$pass,$db);



  $Act        = $_GET['Act'];
  if(!empty($_POST['languageid'])) $_SESSION['LANGUAGE'] = $_POST['languageid'];

// include 'language_include.php';

// For language*****************************************************

    $language=$_SESSION['LANGUAGE'];
    if (empty($language)) $lang = "english";
	else
	{
        //get langauge
		$sqllang = "select * from partners_languages where languages_id = $language"; 
		$reslang = mysql_query($sqllang);
		if($rowlang = mysql_fetch_object($reslang)) $lang = strtolower(trim(stripslashes($rowlang->languages_name)));

		//langauge file name
	   	$filename = "lang/".$lang.".php";

		//check whether file exists
		if(!file_exists($filename))
		{
			$lang = "english";
			$language = "";
		}
	}
	require ("lang/".$lang.".php");


// LANGUAGE CLOSE

//Getting Default currency Details
	$currency_code  = $default_currency_code;
	$cur_sql = "SELECT * FROM partners_currency WHERE currency_code='$currency_code' ";
	$res_cur = mysql_query($cur_sql);
	if(mysql_num_rows($res_cur) > 0)
	{
		$row_cur = mysql_fetch_object($res_cur);
		$currSymbol = stripslashes($row_cur->currency_symbol);
		$_SESSION['DEFAULTCURRENCYSYMBOL'] = $currSymbol;
		$currValue 	= stripslashes($row_cur->currency_caption);
		$currCode 	= stripslashes($row_cur->currency_code);
	}
// End Default Currency	

 # daily procedures

 include_once 'dailyroutine.php';
 ChangeStaus($minimum_amount);
 getProgramFee();
 setPending();
 payMembership();
 setMemPending();
 
 //Remove this when cron job is set for this file
 //include_once "cron/dailyjobs_anp.php";
?>
<?php
 include "header.php";
?>
<div id="page">
<?php
 switch ($Act)
 {
 	case 'payments':
         include 'payment_gateways.php';
    break;

    case 'paypal':
        include 'paypal.php';
        break;

    case 'Payment':
        include 'balancepay.php';
        break;

     case 'stormpay':
         include 'stormpay.php';
        break;
	case 'authorize':
         include 'authorize.php';
        break;
	case 'egold':
         include 'egold.php';
        break;
     case 'checkout':
         include 'checkout.php';
        break;     

      case  "affil_regi"  :
      include "new_affil_regi.php";
       break;

     case 'directory' :
       include "newdirectory.php";
       break;

      case 'login' :
       include "newlogin.php";
       break;    

     default :

            header("Location: {$snmUrl}/affiliatenetwork/affiliates/index.php?Act=Home");

      break;
 }
 ?>
 </div>
<?php
      include "footer.php";
?>